from typing import List
import numpy as np


def get_recall_from_confusion_matrix(cm: np.ndarray) -> List[float]:
    recall = []
    for i in range(cm.shape[1]):
        recall.append(cm[i, i] / np.sum(cm[i, :]))
    return recall


def get_precision_from_confusion_matrix(cm: np.ndarray) -> List[float]:
    precision = []
    for i in range(cm.shape[1]):
        precision.append(cm[i, i] / np.sum(cm[:, i]))
    return precision


def get_distribution_from_confusion_matrix(cm: np.ndarray) -> List[float]:
    dist = []
    for i in range(cm.shape[1]):
        dist.append(np.sum(cm[i, :]) / np.sum(cm))
    return dist
